package com.abk.ets.data;

// Generated 26 avr. 2013 10:28:47 by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Membre generated by hbm2java
 */
@Entity
@Table(name = "membre", catalog = "etsdatabase")
public class Membre implements java.io.Serializable {

	private int idMembre;
	private Societe societe;
	private Personne personne;

	public Membre() {
	}

	public Membre(Societe societe, Personne personne) {
		this.societe = societe;
		this.personne = personne;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "personne"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "idMembre", unique = true, nullable = false)
	public int getIdMembre() {
		return this.idMembre;
	}

	public void setIdMembre(int idMembre) {
		this.idMembre = idMembre;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idsociete", nullable = false)
	public Societe getSociete() {
		return this.societe;
	}

	public void setSociete(Societe societe) {
		this.societe = societe;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public Personne getPersonne() {
		return this.personne;
	}

	public void setPersonne(Personne personne) {
		this.personne = personne;
	}

}
